let mission_collection_SQLMap = new Map()

//插入任务
mission_collection_SQLMap.set("insertMission"," INSERT INTO MissionManagermentSystem.mission_collection (content, priority, mission_name, deadline, mission_type) VALUES (?, ?, ?, ?, ?)")
//删除任务
mission_collection_SQLMap.set("deleteMission"," DELETE FROM MissionManagermentSystem.mission_collection WHERE id = ?")
//查询今天的任务
mission_collection_SQLMap.set("selectTodayAllMission","select mission_collection.id as mission_id,content,priority,mission_name,DATE_FORMAT(deadline,'%Y-%m-%d %H:%i:%s') as deadline,COALESCE(staff_id,'UNSPECIFIED') as staff_id ,COALESCE(s.name,'UNSPECIFIED') as name,COALESCE(sma.status,'UNSPECIFIED') as status \n" +
    "from mission_collection\n" +
    "left  join staff_mission_assign sma on mission_collection.id = sma.mission_id\n" +
    "  left  join staff s on sma.staff_id = s.id\n" +
    "  where  TIMESTAMPDIFF(SECOND,Date(now()),deadline)< 86400 && TIMESTAMPDIFF(SECOND,Date(now()),deadline)>=0")
//查询明天的任务
mission_collection_SQLMap.set("selectTomorrowAllMission","select mission_collection.id as mission_id,content,priority,mission_name,DATE_FORMAT(deadline,'%Y-%m-%d %H:%i:%s') as deadline,COALESCE(staff_id,'UNSPECIFIED') as staff_id ,COALESCE(s.name,'UNSPECIFIED') as name,COALESCE(sma.status,'UNSPECIFIED') as status \n" +
    "from mission_collection\n" +
    "left  join staff_mission_assign sma on mission_collection.id = sma.mission_id\n" +
    "  left  join staff s on sma.staff_id = s.id\n" +
    "where  TIMESTAMPDIFF(SECOND,Date(now()),deadline)>=86400 && TIMESTAMPDIFF(SECOND,Date(now()),deadline)<172000")
//
mission_collection_SQLMap.set("selectAllMissionIncludeStatus",
    "select mission_collection.id as mission_id,content,priority,mission_name,DATE_FORMAT(deadline,'%Y-%m-%d %H:%i:%s') as deadline,COALESCE(staff_id,'UNSPECIFIED') as staff_id ,COALESCE(s.name,'UNSPECIFIED') as name,COALESCE(sma.status,'UNSPECIFIED') as status \n" +
    "from mission_collection\n" +
    "left  join staff_mission_assign sma on mission_collection.id = sma.mission_id\n" +
    "  left  join staff s on sma.staff_id = s.id")
//查询所有任务
mission_collection_SQLMap.set("selectAllMission","select mission_collection.id as mission_id,content,priority,mission_name,DATE_FORMAT(deadline,'%Y-%m-%d %H:%i:%s') as deadline,mission_type \n" +
    "from mission_collection")


module.exports=mission_collection_SQLMap